﻿using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SyncCuringData
{
    /*===================================================
	* 类名称: LogHelper
	* 类描述:
	* 创建人: 75259
	* 创建时间: 2018/12/25 12:16:46
	* 修改人: 
	* 修改时间:
	* 版本： @version 1.0
	=====================================================*/
    public static class LogHelper
    {
        /// <summary>
        /// 打印提示
        /// </summary>
        /// <param name="txt"></param>
        public static void Info(string txt)
        {
            ILog log = log4net.LogManager.GetLogger("InfoLog");
            log.Info(txt);
        }

        /// <summary>
        /// 打印提示
        /// </summary>
        /// <param name="txt"></param>
        public static void Info(string txt, Type type)
        {
            ILog log = log4net.LogManager.GetLogger(type);
            log.Info(txt);
        }

        /// <summary>
        /// 打印错误
        /// </summary>
        /// <param name="msg"></param>
        public static void Error(string msg)
        {
            ILog log = log4net.LogManager.GetLogger("ErrorLog");
            log.Error(msg);
        }
        /// <summary>
        /// 打印错误
        /// </summary>
        /// <param name="msg"></param>
        public static void Error(string msg, Exception ex)
        {
            ILog log = log4net.LogManager.GetLogger("ErrorLog");
            log.Error(msg, ex);
        }


        /// <summary>
        /// 打印Debug
        /// </summary>
        /// <param name="msg"></param>
        public static void Debug(string msg)
        {
            ILog log = log4net.LogManager.GetLogger("DebugLog");
            log.Debug(msg);
        }
        /// <summary>
        /// 打印Debug
        /// </summary>
        /// <param name="msg"></param>
        public static void Debug(string msg, Exception ex)
        {
            ILog log = log4net.LogManager.GetLogger("DebugLog");
            log.Debug(msg, ex);
        }



        /// <summary>
        /// 打印Warn
        /// </summary>
        /// <param name="msg"></param>
        public static void Warn(string msg)
        {
            ILog log = log4net.LogManager.GetLogger("WarnLog");
            log.Warn(msg);
        }
        /// <summary>
        /// 打印Debug
        /// </summary>
        /// <param name="msg"></param>
        public static void Warn(string msg, Exception ex)
        {
            ILog log = log4net.LogManager.GetLogger("WarnLog");
            log.Debug(msg, ex);
        }
    }
}
